package dados.persistencias;

import java.util.List;

import javax.persistence.TypedQuery;

import negocio.erro.DaoException;
import basica.academico.Grade;
import dados.geral.DAOGenerico;
import dados.interfaces.IDAOGrade;

public class DAOGrade extends DAOGenerico<Grade> implements IDAOGrade {
	@Override
	public List<Grade> pesquisarGradePorSemestre(String semestre) throws DaoException {
		TypedQuery<Grade> query = entityManager.createQuery(
				"from Grade grade where grade.semestre = :semestre", Grade.class);
		query.setParameter("semestre", "%" + semestre + "%");
		return query.getResultList();
	}
}
